package internal;

import java.lang.reflect.Method;

/** 封装注册对象,实际的事件订阅者
 * Created by DJJ on 2019/3/28.
 */
public class MySubscriber {
    /**
     * 需要推送对应消息的类,new 出来
     */
    private final Object subscribeObject;
    /**
     *  推送消息的对应的方法
     */
    private final Method subscribeMethod;
    /**
     * 用于取消订阅,避免删除
     */
    private boolean disable = false;

    public MySubscriber(Object subscribeObject, Method subscribeMethod) {
        this.subscribeObject = subscribeObject;
        this.subscribeMethod = subscribeMethod;
    }

    public Object getSubscribeObject() {
        return subscribeObject;
    }

    public Method getSubscribeMethod() {
        return subscribeMethod;
    }

    public boolean isDisable() {
        return disable;
    }

    public void setDisable(boolean disable) {
        this.disable = disable;
    }
}
